home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / 92052tar.gz / 920528.tar / enet.h < prev    next >
C/C++ Source or Header  |  1992-05-14  |  1KB  |  54 lines

  1. /* @(#) $Header: enet.h,v 1.4 92/05/14 13:19:55 deyke Exp $ */
  2.  
  3. #ifndef _ENET_H
  4. #define _ENET_H
  5.  
  6. /* Generic Ethernet constants and templates */
  7. #ifndef _GLOBAL_H
  8. #include "global.h"
  9. #endif
  10.  
  11. #ifndef _MBUF_H
  12. #include "mbuf.h"
  13. #endif
  14.  
  15. #ifndef _IFACE_H
  16. #include "iface.h"
  17. #endif
  18.  
  19. #define EADDR_LEN       6
  20. /* Format of an Ethernet header */
  21. struct ether {
  22.     char dest[EADDR_LEN];
  23.     char source[EADDR_LEN];
  24.     int16 type;
  25. };
  26. #define ETHERLEN        14
  27.  
  28. /* Ethernet broadcast address */
  29. extern char Ether_bdcst[];
  30.  
  31. /* Ethernet type fields */
  32. #define IP_TYPE         0x800   /* Type field for IP */
  33. #define ARP_TYPE        0x806   /* Type field for ARP */
  34. #define REVARP_TYPE     0x8035  /* Type field for reverse ARP */
  35.  
  36. #define RUNT            60      /* smallest legal size packet, no fcs */
  37. #define GIANT           1514    /* largest legal size packet, no fcs */
  38.  
  39. #define MAXTRIES        16      /* Maximum number of transmission attempts */
  40.  
  41. /* In file enet.c: */
  42. char *pether __ARGS((char *out,char *addr));
  43. int gether __ARGS((char *out,char *cp));
  44. int enet_send __ARGS((struct mbuf *bp,struct iface *iface,int32 gateway,int tos));
  45. int enet_output __ARGS((struct iface *iface,char dest[],char source[],int16 type,
  46.     struct mbuf *data));
  47. void eproc __ARGS((struct iface *iface,struct mbuf *bp));
  48.  
  49. /* In enethdr.c: */
  50. struct mbuf *htonether __ARGS((struct ether *ether,struct mbuf *data));
  51. int ntohether __ARGS((struct ether *ether,struct mbuf **bpp));
  52.  
  53. #endif  /* _ENET_H */
  54.